#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int func(int n)
{
	int i = n;
	int j = n;
	while (j > 1)
	{
		i = i + j / 2;
		j = j / 2 + j % 2;
	}
	return i;
}
int main()
{
	printf("%d", func(20));
	return 0;
 }